<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: plot_sphere</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: plot_sphere</td>
      <td class="subheader-left"><a href="matlab:open plot_sphere">View code for plot_sphere</a></td>
    </tr>
  </table>
<h1>plot_sphere</h1><p><span class="helptopic">Draw sphere</span></p><p>
<span style="color:red">plot_sphere</span>(<strong>C</strong>, <strong>R</strong>, <strong>ls</strong>) draws spheres in the current plot.  <strong>C</strong> is the
centre of the sphere (3x1), <strong>R</strong> is the radius and <strong>ls</strong> is an optional MATLAB
color spec, either a letter or a 3-vector.

</p>
<p>
<strong>H</strong> = <span style="color:red">plot_sphere</span>(<strong>C</strong>, <strong>R</strong>, <strong>color</strong>) as above but returns the handle(s) for the
spheres.

</p>
<p>
<strong>H</strong> = <span style="color:red">plot_sphere</span>(<strong>C</strong>, <strong>R</strong>, <strong>color</strong>, <strong>alpha</strong>) as above but <strong>alpha</strong> specifies the opacity
of the sphere were 0 is transparant and 1 is opaque.  The default is 1.

</p>
<p>
If <strong>C</strong> (3xN) then N sphhere are drawn and <strong>H</strong> is Nx1.  If <strong>R</strong> (1x1) then all
spheres have the same radius or else <strong>R</strong> (1xN) to specify the radius of
each sphere.

</p>
<h2>Example</h2>
<p>
Create four spheres

</p>
<pre style="width: 90%%;" class="examples">
plot_sphere(&nbsp;mkgrid(2,&nbsp;1),&nbsp;.2,&nbsp;'b')
</pre>
<p>
and now turn on a full lighting model

</p>
<pre style="width: 90%%;" class="examples">
lighting&nbsp;gouraud
light
</pre>
<h2>NOTES</h2>
<ul>
  <li>The sphere is always added, irrespective of figure hold state.</li>
  <li>The number of vertices to draw the sphere is hardwired.</li>
</ul>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>